package com.iflytek.aisol.audit.iflytek.strategy.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.FieldNameConstants;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * CLassName: channelConfig
 * Description: channel配置表
 * Author: wuzhixiang
 * Date: 2024-12-28 13:53
 * Version: 1.0
 *
 * @author hswang7
 */
@Table(name = "ChannelConfig")
@Entity
@Data
@FieldNameConstants
public class ChannelConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * channel的类型支持以下类型的值
     * ive,vdt,rit,llmAudit_RAG,llmAudit
     */
    @Column(name = "template_name")
    private String templateName;

    /**
     * channnel的配置是一个json格式，不同的template_name配置不同
     */
    @Column(name = "config")
    private String config;

    /**
     * 0未删除  1删除
     */
    @Column(name = "deleted")
    private Integer deleted;

    /**
     * 数字字母下滑线组合的唯一标识
     */
    @Column(name = "channel_id")
    private String channelId;

    /**
     * 版本号，每次修改config时，
     * 需要修改版本+1，同时复制旧版本的数据到此表中
     */
    @Column(name = "version")
    private Long version;


    /**
     * 描述信息
     */
    @Column(name = "`desc`")
    private String description;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@ColumnDefault("CURRENT_TIMESTAMP")
    private Date createTime = new Date();

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@ColumnDefault("CURRENT_TIMESTAMP")
    private Date updateTime=new Date();

}
